package schema.model;

import model.BasicBean;
import java.sql.ResultSet;

public class SchemaTableColumn extends BasicBean {

    public String COLUMN_NAME = "";
    public String COLUMN_TYPE = "";
    public String COLUMN_COMMENT = "";

    public SchemaTableColumn() {
    }

    public SchemaTableColumn(ResultSet rs) {
        try {
            COLUMN_NAME = validateString(rs.getString("COLUMN_NAME"));
            COLUMN_TYPE = validateString(rs.getString("COLUMN_TYPE"));
            COLUMN_COMMENT = validateString(rs.getString("COLUMN_COMMENT"));
            id = COLUMN_NAME;
        } catch (Exception e) {
            System.out.println(e);
        }
    }

    @Override
    public String getHtmlRow() {
        String sz = "";
        sz += "<td class='st4middle'>" + COLUMN_NAME + "</td>";
        sz += "<td class='st4middle'>" + COLUMN_TYPE + "</td>";
        sz += "<td class='st4middle'>" + COLUMN_COMMENT + "</td>";
        return sz;
    }
}